export class util{

    public static readonly maxY = -500      //柱子最高点
    public static readonly minY = -750      //柱子最低点
    public static readonly maxX = 400       //柱子平面最宽点
    public static readonly minX = 250       //柱子平面最窄点
    public static readonly defaultPos = new cc.Vec2(-250,-500)      //柱子默认初始坐标
    public static readonly moveSpeed = 350  //柱子移动速度

    //麒麟子版适配分辨率
        public static resize() {
        var cvs = cc.find('Canvas').getComponent(cc.Canvas);
        //保存原始设计分辨率，供屏幕大小变化时使用
        var dr = cvs.designResolution;
        var s = cc.view.getFrameSize();
        var rw = s.width;
        var rh = s.height;
        var finalW = rw;
        var finalH = rh;
 
        if((rw/rh) > (dr.width / dr.height)){
            //!#zh: 是否优先将设计分辨率高度撑满视图高度。 */
            //cvs.fitHeight = true;
            
            //如果更长，则用定高
            finalH = dr.height;
            finalW = finalH * rw/rh;
        }
        else{
            /*!#zh: 是否优先将设计分辨率宽度撑满视图宽度。 */
            //cvs.fitWidth = true;
            //如果更短，则用定宽
            finalW = dr.width;
            finalH = rh/rw * finalW;
        }
        cvs.designResolution = cc.size(finalW, finalH);
        cvs.node.width = finalW;
        cvs.node.height = finalH;
    }
}